package tgc.edu.yzy.jdbc.score;

import java.sql.Connection;
import java.sql.DriverManager;

public class ScoreConn {
	private static String a1="com.mysql.jdbc.Driver";
	private static String a2="jdbc:mysql://47.100.197.180:3306/cqrobot";
	private static String a3="qqrobot";
	private static String a4="936642284";
	
	
	
	/*private static String a2="jdbc:mysql://localhost:3306/cqrobot";
	private static String a3="root";
	private static String a4="root";*/
	public static Connection conn() {//链接数据库
		
		Connection connection=null;
		try {
			Class.forName(a1);//注册驱动
			connection =DriverManager.getConnection(a2,a3,a4);//建立链接
		}catch(Exception e) {
			System.out.println("数据库不存在，");
			return null;
		}
		return connection;
		
	}
}
